<?php

class Archievement {

    private $id;
    private $name;
    private $description;
    private $points;
    private $creator;
    private $picture;
    private $category;
    private $done;
    private $date_add;
    private $date_finish;
    private $date_limit;
    private $id_visual;

    function __construct($id, $name, $description, $points, $creator, $category, $done, $date_add, $date_finish, $date_limit, $id_visual) {
        $this->id = $id;
        $this->name = $name;
        $this->description = $description;
        $this->points = $points;
        $this->creator = $creator;
        $this->category = $category;
        $this->done = $done;
        $this->date_add = $date_add;
        $this->date_finish = $date_finish;
        $this->date_limit = $date_limit;
        $this->id_visual = $id_visual;
    }

    public function getId() {
        return $this->id;
    }

    public function setId($id) {
        $this->id = $id;
    }

    public function getName() {
        return $this->name;
    }

    public function setName($name) {
        $this->name = $name;
    }

    public function getDescription() {
        return $this->description;
    }

    public function setDescription($description) {
        $this->description = $description;
    }

    public function getPoints() {
        return $this->points;
    }

    public function setPoints($points) {
        $this->points = $points;
    }

    public function getCreator() {
        return $this->creator;
    }

    public function setCreator($creator) {
        $this->creator = $creator;
    }

    public function getPicture() {
        return $this->picture;
    }

    public function setPicture($picture) {
        $this->picture = $picture;
    }

    public function getCategory() {
        return $this->category;
    }

    public function setCategory($category) {
        $this->category = $category;
    }

    public function isDone() {
        return $this->done;
    }

    public function setDone($done) {
        $this->done = $done;
    }

    public function getDateAdd() {
        return $this->date_add;
    }

    public function setDateAdd($date_add) {
        $this->date_add = $date_add;
    }

    public function setDateFinish($date_finish) {
        $this->date_limit = $date_finish;
    }

    public function getDateFinish() {
        return $this->date_finish;
    }

    public function getDateLimit() {
        return $this->date_limit;
    }

    public function setDateLimit($date_limit) {
        $this->date_limit = $date_limit;
    }

    public function getIdVisual() {
        return $this->id_visual;
    }

    public function setIdVisual($id_visual) {
        $this->id_visual = $id_visual;
    }

    function printArchievement() {
        $col = $this->done ? 'left' : 'right';
        $undone = $this->done ? '' : '_undone';
        $pageURL = dirname(dirname(__FILE__));
        return "<li id='achievement_" . $this->id . "' value='" . $this->id . "' class='" . $col . "_achievement_li'>
                <div class='achievement" . $undone . "'><spam class='achievement_name'>" . $this->name . "</spam><spam class='achievement_description'>" . $this->description . "</spam>
                    <a class='achievement_share' href='http://www.facebook.com/sharer.php?s=100&p[summary]=" . $this->description . "&p[url]=" . $pageURL . "&p[title]=" . $this->name . "' target='_blank'>
   Share
</a>
                    
</div>
              </li>";
    }

}

?>